UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+xybaPnAEixa3Vad6+LDObnNCL4zejV8ouwZ0kWpgZg=' 
WHERE 
  key_id = '37264586d710f6d61413a075498ce354a5d1008720032203a975a07487f2b3c5' 
  AND (
    token = '+xybaPnAEixa3Vad6+LDObnNCL4zejV8ouwZ0kWpgZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028