UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4dw0C4EwFMno9o9oxLLqvRD8eiEoARDqLo5RjL6i3qg='
WHERE
key_id = '5658854a0963296007c3f3b26d71c1ed6fd4139d6dc848fa33d7037cb643d9e2'
AND (
token = '4dw0C4EwFMno9o9oxLLqvRD8eiEoARDqLo5RjL6i3qg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)