UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUP32HW9nNyItvzinXkKJik29wqvUUhmOOfuhO9wGP8='
WHERE
key_id = '15f120a07bc861b4939e966456045af847a78c881818479289f2385caa74819e'
AND (
token = 'oUP32HW9nNyItvzinXkKJik29wqvUUhmOOfuhO9wGP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)