UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0+0wCoMSb7eSQj1ntC0ZHZ2eWiDyaLEUArYUQp57oN4=' 
WHERE 
  key_id = '6ae57faf501e07b6c42eb9879b28c8db92c75dbab2eb3af86a4333e71e5abf01' 
  AND (
    token = '0+0wCoMSb7eSQj1ntC0ZHZ2eWiDyaLEUArYUQp57oN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028