UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ySNUyMsDR5Cv5Klth0s5lacpT+N7nXBZ1y1q+HN5Zo='
WHERE
key_id = 'c7b443b7362caf6c9125d1a811f2b8f61bafdeea8c21498b5c647e4cd6051068'
AND (
token = '/ySNUyMsDR5Cv5Klth0s5lacpT+N7nXBZ1y1q+HN5Zo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)