UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L99QEb7usP4tuxQXooj4cxCiter+CyaFPsos+VeMVQI='
WHERE
key_id = '670627ce88ff3ad8060886e4a419e0d41035c107ddb6a9411f4f30c0d69bd048'
AND (
token = 'L99QEb7usP4tuxQXooj4cxCiter+CyaFPsos+VeMVQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)