UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F2BxEwJB9hFdl85LA5md3BTrxMHVGDkvRVxJNxfIRDs=' 
WHERE 
  key_id = '4176adca6c1bf5150d62d2e1e0d2ed04a360973b589693fcbe0ac7f527bc99c4' 
  AND (
    token = 'F2BxEwJB9hFdl85LA5md3BTrxMHVGDkvRVxJNxfIRDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050