UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFf2FDkVVT53YzW7tsEPU4uSt7lKmleJzIL60lCYWF8=' 
WHERE 
  key_id = '72f66f9cde700e0e100678b4b1c3b5e9840788a6cfc6bfb19793619b3b7f0ee6' 
  AND (
    token = 'OFf2FDkVVT53YzW7tsEPU4uSt7lKmleJzIL60lCYWF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037