UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQKQfh1rmuxmGXNuiKs8HBfJnV4mvWhN6Jbq4xPHrCA='
WHERE
key_id = '188eeba86e7cefb29bceae5c14cb9900ad0304504ccae816af1838fbe4ff9f91'
AND (
token = 'kQKQfh1rmuxmGXNuiKs8HBfJnV4mvWhN6Jbq4xPHrCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)