UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evbN93x0UT6NtC+YXBeDKcNzl/W5z662iO2BNeiILeQ=' 
WHERE 
  key_id = 'a75e500b16b7f34f521db38a90c33d0595e19b99fd62506e0bcdbde52a4d834d' 
  AND (
    token = 'evbN93x0UT6NtC+YXBeDKcNzl/W5z662iO2BNeiILeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033