UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xCzFoaNkqDrWGghZkk/VHnisRaiMPzV4/HnWhgCMzUw=' 
WHERE 
  key_id = '625c86a7c94f9011c060a1c7d755066adbdf3aca5ef5625e45212917e30340d2' 
  AND (
    token = 'xCzFoaNkqDrWGghZkk/VHnisRaiMPzV4/HnWhgCMzUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026