UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z0vZ2FGvzx72bm+8YBGSRgJ6PxhToBGLIb+60FkwL1g=' 
WHERE 
  key_id = '0f380f54d841a1af8df7856faa4edfea7be8572d2a278dacd87ae2ed5264a198' 
  AND (
    token = 'Z0vZ2FGvzx72bm+8YBGSRgJ6PxhToBGLIb+60FkwL1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029