UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e/HCzQhzgyf+g7OyWjDvfv25lCUPZo18Ol22ISpVMzg=' 
WHERE 
  key_id = '48063171c76c904704014d7918aba212433ae051b3d02a484df8688bde62e1aa' 
  AND (
    token = 'e/HCzQhzgyf+g7OyWjDvfv25lCUPZo18Ol22ISpVMzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039