UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2eHwjqFtYdLAq3D1rKxXzjUgZVpvi4QGNpu7ZJ13FMA='
WHERE
key_id = '79bd3ae2b1568caf3ea2a5e9230bb7e47ccba1aa5bff6a18132a5b063b3af023'
AND (
token = '2eHwjqFtYdLAq3D1rKxXzjUgZVpvi4QGNpu7ZJ13FMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)