UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '99suOv3WJmzfU94KLS+uLzwaWgWyWm16R9lG2CRA7/Y=' 
WHERE 
  key_id = 'a926fb24640459a3f206bd175ad528cec9de29b1755029c51ca949edee9fc9f8' 
  AND (
    token = '99suOv3WJmzfU94KLS+uLzwaWgWyWm16R9lG2CRA7/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039