UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ye6EnyIQUARJUBxKYB5PHAn2yZNtV5iyM1l0rCaUYKQ='
WHERE
key_id = 'c932c893b9541b3fe07520d60a5180a8e8c038299484dd1cbefb14907ae2e440'
AND (
token = 'ye6EnyIQUARJUBxKYB5PHAn2yZNtV5iyM1l0rCaUYKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)