UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2xNQZd/Fy74tV71md7Vbypzg55u0D9TvmiM9hlzUS8='
WHERE
key_id = '48b473283e07b3b3b2f7cb5974cf6b58dc85cb4aeb791fc0be2b8a83e9b91250'
AND (
token = 'w2xNQZd/Fy74tV71md7Vbypzg55u0D9TvmiM9hlzUS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)