UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dBnsCWFR2rG78/QyQxYgRwrQUuxhFr3N0BJIBGhweD0=' 
WHERE 
  key_id = 'aab1c77d476a78c3c699a683d8824575d3b79d76d28ffc05411b1ce927b18ed7' 
  AND (
    token = 'dBnsCWFR2rG78/QyQxYgRwrQUuxhFr3N0BJIBGhweD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030