UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cxDDHaxMnTfRy8XTumQ1/KZbSiTeMjR/1jf5Zbw4mWs=' 
WHERE 
  key_id = 'ef8984c218889a7a7ea57d5186a9536a901de873c7d7f4a020adf597f9765f74' 
  AND (
    token = 'cxDDHaxMnTfRy8XTumQ1/KZbSiTeMjR/1jf5Zbw4mWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027