UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pu/ZPpDanJQjkl99LUcIt2tG6Q1fglkkP61zf/AVsRY='
WHERE
key_id = '4e5fa298a0d4ba827b6e9bf8f19e5d1c5897eeee330484361eabd3de6eb87bea'
AND (
token = 'Pu/ZPpDanJQjkl99LUcIt2tG6Q1fglkkP61zf/AVsRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)