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