UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zxwb9qPzyEgfs6t6QDNdnBIO5e8TrwdUSifxQrdKIl0=' 
WHERE 
  key_id = 'a090900fe13b862acef6ce0175dcbe8d3c839a313d865bfbcd4daade1710f9a5' 
  AND (
    token = 'zxwb9qPzyEgfs6t6QDNdnBIO5e8TrwdUSifxQrdKIl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046