UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xQjP2swDVa1uy/9vRXZmDInicJUOtyg03Cx00q5ePZw='
WHERE
key_id = '7464309eff344625a931e379efde8e9125d6ccdcf15bbe791f1dc734a4c0185e'
AND (
token = 'xQjP2swDVa1uy/9vRXZmDInicJUOtyg03Cx00q5ePZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)