UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Fbku7PmyRuP4NyN9RSKc504TABzSZJ+GI8PUIh4tbY=' 
WHERE 
  key_id = '26dc65a9e7c441894af6d800b7730eb6d298f640a436885ae2e9966ed182a8f5' 
  AND (
    token = '1Fbku7PmyRuP4NyN9RSKc504TABzSZJ+GI8PUIh4tbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033