UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4+p8qMz9TDXrkq+raJb6QoguWge/LTd+KDfCiWKf4k='
WHERE
key_id = '23809b9840970da8923828ae3a21e345fa8a8ba33692bd89c678134f8c6f368a'
AND (
token = 'F4+p8qMz9TDXrkq+raJb6QoguWge/LTd+KDfCiWKf4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)