UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BYRf4qfU1SRBmTobb/iw6kXkXajljCeCRG61ZjmfOSE='
WHERE
key_id = '8f6ac3b82fd19afbd5f71c9884319caa03da6eae859f332691d4c2fc99eb2825'
AND (
token = 'BYRf4qfU1SRBmTobb/iw6kXkXajljCeCRG61ZjmfOSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)