UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rlw2L5XwNLWfWljvk4ZPrVS/h//dCWCqPvDQBe5N0wY=' 
WHERE 
  key_id = 'df8b206b8770a7c885b687a2751f3c73e8a8b82b7b29d7494f59177a107c34e5' 
  AND (
    token = 'Rlw2L5XwNLWfWljvk4ZPrVS/h//dCWCqPvDQBe5N0wY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015