UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o7bvI4ifoFdQFhiJ7ydm5rUo/XNp6VM1vJpXAffjlDQ='
WHERE
key_id = '887207e61bc3bd0f21df48ceb27580fc889c69a2f05b1dd6a833a3998f63e7a5'
AND (
token = 'o7bvI4ifoFdQFhiJ7ydm5rUo/XNp6VM1vJpXAffjlDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)